/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package beans;

import java.util.Date;
import javax.servlet.http.HttpServletRequest;

import org.apache.struts.action.ActionErrors;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.action.ActionMessage;

/**
 *
 * @author sh
 */
public class SuspendUserBean extends org.apache.struts.action.ActionForm {
    
    private String reason;

    private String expireDate;

    private String[] expired;

    public String getReason() {
        return reason;
    }

    public void setReason(String reason) {
        this.reason = reason;
    }

  

    public String getExpireDate() {
        return expireDate;
    }

    public void setExpireDate(String expireDate) {
        this.expireDate = expireDate;
    }

    public String[] getExpired() {
        return expired;
    }

    public void setExpired(String[] expired) {
        this.expired = expired;
    }

 

    /**
     *
     */
    public SuspendUserBean() {
        super();
        // TODO Auto-generated constructor stub
    }

    /**
     * This is the action called from the Struts framework.
     * @param mapping The ActionMapping used to select this instance.
     * @param request The HTTP Request we are processing.
     * @return
     */
    public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) {
        ActionErrors errors = new ActionErrors();
       // System.out.println("XXXXXXXXXXXAAAAAAAAAAASSSSSSSSSSSSSS"+expireDate);
         expired=expireDate.split("/");
        if(expired.length!=3){
            errors.add("date error", new ActionMessage("errordate"));
        }
        return errors;
    }
}
